package org.jeecg.modules.manage.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;

import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 公司信息
 * @Author: jeecg-boot
 * @Date:   2021-08-11
 * @Version: V1.0
 */
@Data
@TableName("sys_config")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="sys_config对象", description="公司信息")
public class SysConfig implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private java.lang.String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private java.lang.String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private java.util.Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private java.lang.String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private java.util.Date updateTime;
	/**公司代码*/
	@Excel(name = "公司代码", width = 15)
    @ApiModelProperty(value = "公司代码")
    private java.lang.String companyCode;
	/**公司名称*/
	@Excel(name = "公司名称", width = 15)
    @ApiModelProperty(value = "公司名称")
    private java.lang.String comanyNameZh;
	/**公司英文名称*/
	@Excel(name = "公司英文名称", width = 15)
    @ApiModelProperty(value = "公司英文名称")
    private java.lang.String comanyNameEn;
	/**公司网址*/
	@Excel(name = "公司网址", width = 15)
    @ApiModelProperty(value = "公司网址")
    private java.lang.String companyWebsize;
	/**金重精度*/
	@Excel(name = "金重精度", width = 15)
    @ApiModelProperty(value = "金重精度")
    private java.lang.Integer goldWeightAccuracy;
	/**钻石精度*/
	@Excel(name = "钻石精度", width = 15)
    @ApiModelProperty(value = "钻石精度")
    private java.lang.Integer diamondWeightAccuracy;
	/**石重金重比*/
	@Excel(name = "石重金重比", width = 15)
    @ApiModelProperty(value = "石重金重比")
    private java.lang.Double diamondGoldWeightProportion;
	/**连接电子磅*/
	@Excel(name = "连接电子磅", width = 15, dicCode = "yn")
	@Dict(dicCode = "yn")
    @ApiModelProperty(value = "连接电子磅")
    private java.lang.Integer hasScale;
	/**默认使用工序方式*/
	@Excel(name = "默认使用工序", width = 15, dicCode = "use_procedure")
	@Dict(dicCode = "use_procedure")
    @ApiModelProperty(value = "默认使用工序")
    private java.lang.Integer useProcedure;
	/**审完订单自动生产开单 */
	@Excel(name = "审完订单自动转生产开单", width = 15, dicCode = "is_auto_open_workorder")
	@Dict(dicCode = "is_auto_open_workorder")
    @ApiModelProperty(value = "审完订单自动转生产开单")
    private java.lang.Integer isAutoOpenWorkorder;
	/**开单默认存货人*/
    @ApiModelProperty(value = "开单默认存货人")
    private java.lang.String defaultStoreBy;
	/**公司地址*/
	@Excel(name = "公司地址", width = 15)
    @ApiModelProperty(value = "公司地址")
    private java.lang.String comanyAddress;
	/**公司LOGO*/
	@Excel(name = "公司logo", width = 15)
    private transient java.lang.String comanyLogoString;

	/**
	 * 公司LOGO
	 */
    private byte[] comanyLogo;

    public byte[] getComanyLogo(){
        if(comanyLogoString==null){
            return null;
        }
        try {
            return comanyLogoString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getComanyLogoString(){
        if(comanyLogo==null || comanyLogo.length==0){
            return "";
        }
        try {
            return new String(comanyLogo,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}
